package com.neethi.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name="practice_area")
public class PracticeArea extends BaseObject{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long sid;
	private String name;
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="sid")
	public Long getSid() {
		return sid;
	}

	public void setSid(Long sid) {
		this.sid = sid;
	}

	@Column(name="name", length=100)
	public String getName() {
		return name;
	}

	public void setName(String description) {
		this.name = description;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
            return true;
        }
        if (!(o instanceof PracticeArea)) {
            return false;
        }

        final PracticeArea paracticeArea = (PracticeArea) o;

        return !(name != null ? !name.equals(paracticeArea.getName()) : paracticeArea.getName() != null);
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder(17, 37)
		.append(name)
		.toHashCode();
	}

	@Override
	public String toString() {
		ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE)
		.append("sid", this.sid)
        .append("description", this.name);
		return sb.toString();
	}

}
